{extend name='admin@main'}

{block name="button"}

<!--{if auth("add")}-->
<!--<button data-modal='{:url("add")}' data-title="添加邀请函信息" class='layui-btn layui-btn-sm layui-btn-primary'>添加邀请函信息</button>-->
<!--{/if}-->

{if auth("remove") && ($userinfo['db2']['roleid'] == 1 || $userinfo['db1']['roleid'] == 1)}
<button data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" data-confirm="确定要删除这些信息吗？" action="{:url('department/remove')}" class='layui-btn layui-btn-sm layui-btn-primary'>删除邀请函信息</button>
{/if}

{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='invitation/index_searchapp'}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='list-table-sort-td'>
                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
            </th>
            <th class='text-left nowrap'>访客名称</th>
            {if $userinfo['db1']['authorize'] == 1 || $userinfo['db1']['authorize'] == 8}
                <th class='text-left nowrap'>拜访公司</th>
            {/if}
			<th class='text-left nowrap'>到访部门</th>
			<th class='text-left nowrap'>受访人</th>
            <!-- <th class='text-left nowrap'>拜访目的</th> -->
            <th class='text-center nowrap'>审核状态</th>
            <th class='text-left nowrap'>预约时间</th>
            <th class='text-left nowrap'>操作选项</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
			
        {foreach $list as $key=>$vo}
	 
{php}
{//var_dump($vo);}
   {/php}  
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='list-table-sort-td'>
                <label>{$vo.id}</label>
            </td>
            <td class='text-left nowrap'>{$vo.vister_name|default=''}</td>
            {if $userinfo['db1']['authorize'] == 1 || $userinfo['db1']['authorize'] == 8}
                <td class='text-left nowrap'>{$vo.app_company_name|default=''}</td>
            {/if}
            <td class='text-left nowrap'>{$vo.napp_dept_name|default='-'}</td>
			<td class='text-left nowrap'>{$vo.app_user_name|default='-'}</td>
			<!-- <td class='text-left nowrap'>{$vo.app_reson|default=''}</td> -->
            <td class='text-center nowrap'>
                {eq name='vo.auditing' value='0'}<span class="color-desc">待审核</span>{/eq}
                {eq name='vo.auditing' value='1'}<span class="color-green">同意预约</span>{/eq}
                {eq name='vo.auditing' value='2'}<span class="color-red">不同意</span>{/eq}
          <!--       {eq name='vo.status' value='0'}<span class="color-red">该邀请未答应</span>{/eq}
                {eq name='vo.status' value='1'}<span class="color-green">该邀请已完成</span>{/eq}
                {eq name='vo.status' value='2'}<span class="color-green">该邀请已逾期</span>{/eq}
                {eq name='vo.status' value='3'}<span class="color-green">该邀请逾期完成</span>{/eq} -->
            </td>
            <td class='text-left nowrap'>
                {$vo.createtime|format_datetime}
            </td>
            <td class='text-left nowrap'>

                {if auth("edit")}
               <!--  <a data-dbclick class="layui-btn layui-btn-sm" data-title="编辑员工信息" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a> -->
                {/if}

                {if auth("state") and $vo.auditing eq 0}
               <!--  <a class="layui-btn layui-btn-sm layui-btn-normal" data-action="{:url('state')}" data-value="id#{$vo.id};auditing#1;type#viss" data-csrf="{:systoken('state')}">审核通过</a>
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};auditing#2;type#viss" data-csrf="{:systoken('state')}">审核不通过</a> -->
                 <button data-modal='{:url("details")}?id={$vo.id}&type=viss' data-title="详情" class='layui-btn layui-btn-sm layui-btn-normal'>审 核</button>
                {elseif auth("state") and $vo.auditing eq 1 }
                <a class="layui-btn layui-btn-sm layui-btn-green"  data-value="id#{$vo.id};auditing#0" data-csrf="{:systoken('state')}">该邀请已审核</a>
                {elseif auth("state") and $vo.auditing eq 2 }
                <a class="layui-btn layui-btn-sm layui-btn-green"  data-value="id#{$vo.id};auditing#0" data-csrf="{:systoken('state')}">该邀请已逾期</a>
                {elseif auth("state") and $vo.auditing eq 3 }
                <a class="layui-btn layui-btn-sm layui-btn-green"  data-value="id#{$vo.id};auditing#0" data-csrf="{:systoken('state')}">该邀请已完成</a>
                {/if}




                {if auth("details") and $vo.auditing neq 0}
                <button data-modal='{:url("details")}?id={$vo.id}&type=viss' data-title="详 情" class='layui-btn layui-btn-sm layui-btn-primary'>详 情</button>
                {/if}
                <!--{if auth("remove")}-->
                <!--<a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该邀请信息吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}" action="{:url('user/remove')}">删 除</a>-->
                <!--{/if}-->



            </td>
        </tr>
		  
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
